package com.itheima.test02;

import java.io.*;

/*
复制文件
使用缓冲流 一次复制一个字节
 */
public class Test03 {


    public static void main(String[] args) throws IOException {
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("day12\\copy\\a.jpg"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("day12\\copy\\c.jpg"));
        long start = System.currentTimeMillis();
        int b;
        while ((b=bis.read())!=-1){

            bos.write(b);

        }
        long end = System.currentTimeMillis();
        System.out.println("复制使用了" +(end - start)
        );//复制使用了25
        bis.close();
        bos.close();
    }
}
